<?php
require_once('Vega/Dao/Table.php');

class Mobitv_Admin_RoleDao extends Vega_Dao_Table
{
    public function getDetail($roleId)
    {
        $roleId = $this->_db->valueQuote($roleId);
        $sql = "SELECT * FROM admin_action WHERE id=$roleId";
        $this->_db->query($sql);
        
        return $this->_db->fetchRow();
    }

    public function getActionListFromModule($moduleName)
	{
        $moduleName = $this->_db->valueQuote($moduleName);
        $sql = "SELECT * FROM admin_action WHERE module=$moduleName";
        $this->_db->query($sql);
        
        return $this->_db->fetchRowset();
	}

    public function getModuleList()
    {
        $sql = "SELECT DISTINCT(module) AS name FROM admin_action";
        $this->_db->query($sql);
        
        return $this->_db->fetchRowset();
    }

    public function save($roleId, $data)
    {
        
    }
}
?>